package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.net.URLEncoder;
import org.json.JSONStringer;
import org.json.JSONWriter;
import org.json.JSONObject;

public final class data2_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");

  String aa="chart";
	try {
		JSONStringer json = new JSONStringer();
		json.object();//开始一个json数组
		json.key("elements");//创建一个elements节点
		json.array(); 
		
		json.object();
		json.key("type").value("pie");
		json.key("on-click").value("callJsFunction");
		json.key("colour").value("#EB7600");
		json.key("text").value(aa);
		json.key("font-size").value(12);
		json.key("values").array();
		for(int i=0;i<12;i++){
		    json.value(i);
		}
		json.endArray();
		json.endObject();
		json.endArray();
		
		
		json.key("bg_colour").value("#FFFFFF");
		json.key("title").object().key("text").value(aa+" title").key("style").value("{font-size:22px;color:red;font-weight: bold; color: #234564; text-align: center;}").endObject();
		
		//设置Y轴信息 "y_axis": { "min": -4, "max": 4, "steps": 2, "labels": null, "offset": 0 }, 
		json.key("y_axis").object().key("max").value(12).key("steps").value(3).endObject();
		json.endObject();
		
		out.println(json.toString());
	} catch (Exception e) {

	}

    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
